import java.util.*;
public class Lab09Task04 {
public static void main(String[] args) {
Scanner kb= new Scanner(System.in);
System.out.print("Enter number of distinct corners for teh polygon: ");
int n=kb.nextInt(),i;
double sigma=0;
double[] x=new double[n];
double[] y=new double[n];
System.out.print("Enter the x and y coordinates of corner#1: ");
x[0]=kb.nextDouble();
y[0]=kb.nextDouble();
for(i=1;i<n;i++) {
System.out.printf("Enter the x and y coordinates of corner#%d: ",i+1);
x[i]=kb.nextDouble();
y[i]=kb.nextDouble();
sigma+=(x[i]+x[i-1])*(y[i]-y[i-1]);
}
double area=Math.abs(sigma)/2;
System.out.printf("Polygon area = %.6f sqr meters",area);
kb.close();
}
}